import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import permissionDirective from './plugins/permission-directive'
import "@/assets/icon/iconfont.css"
import type { IEmits } from './plugins/emits'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

declare global {
  interface Window {
    emits: IEmits
  }
}

app.use(createPinia())
app.use(router)
app.use(ElementPlus, { size: "default", zIndex: 20250612, locale: zhCn })
app.directive("auth", permissionDirective);
app.mount('#app')
